
import tkinter as tk

from colortools import ColorTools
from mousetools import MouseTools
from word_to_pdf import WordToPdf


import ctypes
whnd = ctypes.windll.kernel32.GetConsoleWindow()
if whnd != 0:
    ctypes.windll.user32.ShowWindow(whnd, 0)
    ctypes.windll.kernel32.CloseHandle(whnd)




root = tk.Tk()
root.title('实用小工具')
root.geometry("500x500")

# 监听键盘按键
def on_esc_press(event):
    print(event.keysym)
    if event.keysym == 'Escape':
        # 退出鼠标坐标
        MouseTools.flag = False
        ColorTools.colorFlag = False


# 鼠标坐标拾取器
mousetools = MouseTools(root)
mousetools.init()
root.bind("<KeyPress>", on_esc_press)

# 颜色选择器
ColorTools(root)

WordToPdf(root)

if __name__ == "__main__":
    root.mainloop()